from socket import *


def startScan():
	"""
	Method that makes the port scan
	Receive the IP and port range to scan
	"""
	print ' '
	targetIP = raw_input(' Enter IP to scan: ')
	print ' Starting scan on host ', targetIP
	startPort = int(raw_input(' Start on Port: '))
	endPort = int(raw_input(' End on Port: '))
	
	for i in range(startPort, endPort):
		s = socket(AF_INET, SOCK_STREAM)
		result = s.connect_ex((targetIP, i))
		if (result == 0):
			print ' Port %d: OPEN' %(i)
		s.close()
	
	print ' '
